#ifndef BorderItems_First
#define BorderItems_First
#ifdef __GNUG__
#pragma interface
#endif

#include "TextItem.h"
#include "CompVObject.h"

const int
	cBorderTitleGap= 4,
	cHTitleGap     = 10,
	cBorder        = 9,
	cTitleGap      = 5;     // gap between titlebar and contents

//---- Matte -------------------------------------------------------------------

class Matte: public CompositeVObject {
public:
	MetaDef(Matte);

	Matte(VObject *inner);
	Matte(const Point &border, VObject *inner);
	Matte(int id, const Point &border, VObject *inner);

	Point GetBorder();
	void SetBorder(const Point &b);
	void SetOrigin(Point at);
	void SetExtent(Point e);
	Metric GetMinSize();
	OStream& PrintOn(OStream&);
	IStream& ReadFrom(IStream&);

protected:
	Point border;
};

inline Point Matte::GetBorder()
	{ return border; }

//---- BorderItem --------------------------------------------------------------

class BorderItem: public CompositeVObject {
public:
	MetaDef(BorderItem);
	BorderItem(VObject *inner);
	BorderItem(VObject *title, VObject *inner);
	BorderItem(const char *title, VObject *inner);
	void SetTitle(const char *title, bool redraw= TRUE);
	void SetOrigin(Point at);
	void SetExtent(Point e);
	Metric GetMinSize();
	void Draw(Rectangle r);
};

//---- BackgroundItem ----------------------------------------------------------

class BackgroundItem: public CompositeVObject {
public:
	MetaDef(BackgroundItem);
	BackgroundItem(Ink *p, VObject *ip= 0);
	void SetOrigin(Point at);
	void SetExtent(Point e);
	void DrawInner(Rectangle r, bool highlight);
	OStream& PrintOn(OStream&);
	IStream& ReadFrom(IStream&);
protected:
	Ink *ink;
};

#endif

